package com.example.android.sensortest;

import android.app.ActivityGroup;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabWidget;

public class MainActivity extends ActivityGroup {
    TabHost mTabHost;
    TabWidget mTabWidget;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mTabHost = (TabHost) findViewById(android.R.id.tabhost);
        mTabWidget = (TabWidget) findViewById(android.R.id.tabs);

        mTabHost.setup(getLocalActivityManager());

        // Instantiate two tabs with content set to two separate Activities (each defined by
        // an Intent)

        mTabHost.addTab(mTabHost.newTabSpec("sensors")
                .setIndicator("Sensors", getResources().getDrawable(R.drawable.ic_tab_sensors))
                .setContent(new Intent(this, SensorsActivity.class)));

        mTabHost.addTab(mTabHost.newTabSpec("location")
                .setIndicator("Location", getResources().getDrawable(R.drawable.ic_tab_location))
                .setContent(new Intent(this, LocationActivity.class)));
    }
}
